home *** CD-ROM | disk | FTP | other *** search
/ Top 200 Programs / Top 200 Programs.iso / Bob8 / THOMPSON / LIBERTY / PRODUCT / TUTORIAL.EXE / WK6CM1.TXT < prev   
Text File  |  1996-04-04  |  6KB  |  174 lines

  1. Week 6 course material
  2. Liberty BASIC programming course
  3. Copyright 1996 Shoptalk Systems
  4. All Rights Reserved
  5.  
  6.  
  7. Files included with this lesson
  8. ==============================================================================
  9.  
  10.     WK6CM1.TXT    - This file
  11.  
  12.     TRACKER.BAS   - The finished solution to our week 6 project
  13.  
  14.     LETTER.BMP    - These five files are used as icons in our application
  15.     CALL.BMP
  16.     BROCHURE.BMP
  17.     SALE.BMP
  18.     DEADEND.BMP
  19.  
  20.     LETTER.TXT    - An example letter of introduction for our application
  21.     PACKSLIP.TXT  - An example packing slip for our application
  22.  
  23.  
  24. Building Our Application
  25. ==============================================================================
  26.  
  27. We now arrive at the final stage of our Liberty BASIC course.  We will build
  28. a kind of personal information manager for managing sales calls.  Our
  29. application will manage an address list.  Each sales lead in the list will
  30. have a field containing an event status for our sales effort.  Here is a list
  31. of events for each sales lead:
  32.  
  33.   - Letter of Introduction
  34.   - Follow-Up Phone Call
  35.   - Brochure
  36.   - Sale
  37.   - Dead End Lead
  38.  
  39. Our application will provide a means of printing the Letter of Introduction,
  40. personalized with each name and also dated.  We will launch NOTEPAD.EXE to
  41. edit our form letter, and we will used tags (like <nameTag> and <dateTag>)
  42. to insert the name and date where desired.  See the included example file
  43. LETTER.TXT.  When we have printed a Letter of Introduction for any record,
  44. its event status will automatically advance to Follow-Up Phone Call.
  45.  
  46. When making our Follow-Up Phone Call, our application will let us specify
  47. if there was:
  48.  
  49.   - no contact, try later
  50.   - positive contact, send brochure
  51.   - negative contact, dead end lead
  52.  
  53. When we have had positive contact, the event status of the record will
  54. be advanced to brochure.
  55.  
  56. When the sale is made, we will print a packing slip using a technique
  57. similar to the one we will use for printing our letter of introduction.
  58. See the included example file PACKSLIP.TXT.
  59.  
  60.  
  61. Here is a functional description of our application:
  62.  
  63. 1) Main window - When the program is started, a window will open with the
  64. following controls:
  65.  
  66.     a) A combobox with a list of events (letter, call, brochure, etc).
  67.        When we select an event in this control, our application code
  68.        will fill our listbox below c) with leads that have the selected
  69.        event status.
  70.  
  71.     b) A graphicbox for displaying an icon that represents the selection
  72.        in our combobox above a).  This is similar to our week 5 homework.
  73.  
  74.     c) A listbox for holding the names of sales leads.  We will want to
  75.        select a name from this list to perform actions on.
  76.  
  77.     d) A statictext to describe what possible action we can take on a
  78.        lead we select in our listbox above c).
  79.  
  80.     e) A button to invoke the action described in our statictext d).
  81.  
  82. So if we want to work on making phone calls, we select 'call' from the
  83. combobox a).  The graphicbox b) displays our call.bmp file, and listbox c)
  84. fills up with leads that have an event status of 'call'.  The statictext
  85. d) displays 'Make Call'.  Then we select a lead from the listbox c) and
  86. click on button e) and another window opens to present the information we
  87. need to make the call.  Assuming the call is a success, we provide a way
  88. to register this in our application, and the event status of this sales
  89. lead record is advanced to 'brochure'.
  90.  
  91. Our main window will also need buttons for the following:
  92.  
  93.     a) New Lead - Open a window for entering a new record.  Each record
  94.        has these fields:
  95.  
  96.         - First Name
  97.         - Last Name
  98.         - Address 1
  99.         - Address 2
  100.         - City
  101.         - State
  102.         - Zip
  103.         - Phone #
  104.         - Comment
  105.         - Event Status         (not user editable)
  106.         - Date of Last Action  (not user editable)
  107.  
  108.     b) Edit/View Lead - Open a window to view or edit a record.  The fields
  109.        are the same as above.
  110.  
  111.     c) Edit Letter - Run NOTEPAD.EXE to edit a letter of introduction
  112.  
  113.     d) Edit Packslip -Run NOTEPAD.EXE to edit a packing slip
  114.  
  115.  
  116. Try out TRACKER.BAS
  117. ==============================================================================
  118.  
  119. To get a good feel for how the application should work, try the included
  120. TRACKER.BAS program file.  Notice how we use dialog boxes, most of them
  121. modal dialog boxes.  See how we run NOTEPAD.EXE to edit our templates for
  122. our letter of introduction and our packing slip.
  123.  
  124. Because this is a large project, it might be helpful for you to take a
  125. good look at the TRACKER.BAS file.  Running the debugger on it might also
  126. be a good idea.  Then once you have a good idea how things work, start
  127. writing your own code.
  128.  
  129.  
  130. File Input/Output
  131. ------------------------------------------------------------------------------
  132.  
  133. The sales lead records are loaded when the program is started into an
  134. array 500 by 12.  This will work with 500 records (an arbitrary limit).
  135. The first line in our file is a count of the number of records in the file.
  136. Each record's fields are stored one to a line, and LINE INPUT is used to read
  137. them in so that commas can be included in a field's text.  When we quit the
  138. program, the records are saved back to disk.  
  139.  
  140.  
  141. Listboxes
  142. ------------------------------------------------------------------------------
  143.  
  144. The listbox is similar to the combobox we used in our week 5 homework.  It
  145. fills itself with the contents of an array named in its originating
  146. statement, like so:
  147.  
  148.     listbox #main.list, names$(, 10, 10, 100, 250
  149.  
  150. In the statement above, the listbox will fill itself with the contents of
  151. they array named names$(), which must be single dimensioned.  Whenever the
  152. contents of the listbox need to change, the RELOAD command is used, like
  153. so:
  154.  
  155.     print #main.list, "reload"
  156.  
  157.  
  158. Printing the letter of introduction and packing slip
  159. ------------------------------------------------------------------------------
  160.  
  161. Text is sent to the printer using the LPRINT statement.  The following will
  162. send Hello World to the printer:
  163.  
  164.     lprint "Hello World"
  165.     dump  'force the end of page
  166.  
  167. The DUMP statement forces the end of page, which is what you will want to do
  168. each time you print a letter of introduction or print a packing slip.
  169.  
  170.  
  171.  
  172.  
  173.  
  174.